Event = {};
Event.mouse = {};
Event.eventData = {};
function Event.process()
    local event = application.eventData;
end

function Event.isLocation(loc)
    local x = loc.x;
    local y = loc.y;
    local w = loc.width;
    local h = loc.height;
    local mouse = Event.mouse;
    if(mouse.x>=x and mouse.x<=(x+w) and mouse.y>=y and mouse.y<=(y+w))then
        return true;
    end
    return false;
end

function Event.isMouseButtonPress()
    if(mouse.state=="mousebuttonup")then
        return true;
    end
end

--如果未响应的事件，则
function Event.processEvent(w)
    local e;
    for k,v in pairs(Event.eventData)do
        e = Event.eventData;
        break;
    end
    if(Event.eventData[w])then
        return Event.eventData[w],e;
    end
    Event.eventData[w] = w;
    return nil,e;
end

